package com.xbongbong.saas.model;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.saas.domain.entity.ReturnedPurchaseInvoiceEntity;

import java.util.List;
import java.util.Map;

/**
 * @author zhouwq
 * @date 2020/2/24 15:48
 */

public interface ReturnedPurchaseInvoiceModel extends IModel<ReturnedPurchaseInvoiceEntity> {

    /**
     * 保存
     *
     * @param refundInvoiceEntity 实体
     * @return Integer
     */
    Integer save(ReturnedPurchaseInvoiceEntity refundInvoiceEntity) throws XbbException;

    /**
     * 获取发票id
     *
     * @param param 参数
     * @return 删除成功
     */
    List<Long> getInvoiceId(Map<String, Object> param);

    /**
     * 根据采购退货ID删除采购退货发票关系表
     * @param corpid 公司ID
     * @param returnedPurchaseIdList 采购退货ID
     * @return 是否成功
     * @author zhouwq
     * @date 2020/3/10 9:26
     */
    Integer deleteBatchByReturnedPurchaseIdIn(String corpid, List<Long> returnedPurchaseIdList);

    /**
     * 根据退货退款list回滚数据
     *
     * @param corpid       公司id
     * @param refundIdList 退货退款id
     * @return 回滚成功
     */
    Integer updateRollbackByRefundId(String corpid, List<Long> refundIdList);

    /**
     * 根据发票id删除
     *
     * @param invoiceId 发票id
     * @param corpid    公司id
     * @return 删除成功
     */
    Integer deleteByInvoiceId(Long invoiceId, String corpid);

}
